<?php

namespace app\admin\behavior;

use think\Cache;
use think\Request;
use think\Session;
use think\Config;

class Auth
{

    public function run(&$params)
    {



   $arrToken = [
            "code"=>102,
            "msg"=>"token验证错误"
        ];
        $sid = trim($params->param("admin_sid"));
        $token = trim($params->param("token"));


        if(!empty($sid)){
            w_s("sid",$sid);
        }

        $export  = trim($params->param("export"));

        if(!empty($export)){
            w_s("export",$export);
        }


        if(Cache::has($sid)){
            $rows = Cache::get($sid);

            w_s("agent_id",$rows['agent_id']);
            if(empty($rows['admin_group_id'])){
                exit(json_encode(resJson(0,"暂无角色组权限")->getData()));
            }

        }else{
            exit(json_encode(resJson(101,"请重新登录")->getData()));

        }



    }

}
